// 配置 store
import Vue from 'vue'
import Vuex from 'vuex' // 引入vuex包
import state from '../store/state'
import actions from '../store/actions'
import mutations from '../store/mutations'
import getters from '../store/getters'
import detail from '../store/modules/detail' // 引用模块
import cate from '../store/modules/cate'
import carts from '../store/modules/carts'

Vue.use(Vuex); // 安装插件到vue

// 配置接收state等选项，值为对象
let store = new Vuex.Store({
    // 根作用域
    state,
    actions,
    mutations,
    getters,
    modules:{ //模块作用域
        detail,cate,carts
    }
})

export default store